(function(){var a=function(a){return"undefined"===typeof a},b=function(b){return a(b)||null===b},c=function(a,c){if(b(a))throw Error("Argument null: source");if(b(c))return a;for(var d in c)a[d]=c[d];return a},d=function(a,b){if(!a)throw Error("Argument null: cannot create empty namespace name.");for(var d=0<=a.indexOf(".")?a.split("."):[a],f=window,g=0;g<d.length;g++){var h=d[g];"undefined"===typeof f[h]&&(f[h]={});f=f[h]}1<arguments.length&&c(f,b);return f};d("bob.utils",{isUndefined:a,isNull:function(a){return null===
a},isUndefinedOrNull:b,extendObject:c});d("bob.ns",{setNs:d})})();
bob.ns.setNs("bob.assert",{fail:function(a){if(1>=arguments.length)throw Error(bob.utils.ifNullOrWhiteSpace(a,"Assert failed."));var b=bob.collections.extensions.clone(arguments,1,arguments.length-1,[a]);throw Error(bob.string.formatString.apply(null,b));},equals:function(a,b,c){bob.utils.equals(a,b)||bob.assert.fail(bob.utils.ifUndefinedOrNull(c,"Assert equals failed. Actual: {0}. Expected: {1}."),b,a)},notEquals:function(a,b,c){bob.utils.equals(a,b)&&bob.assert.fail(bob.utils.ifUndefinedOrNull(c,
"Assert not-equals failed. Actual: {0}. Comparison: {1}."),b,a)},isTrue:function(a,b){return bob.assert.equals(!0,a,bob.utils.ifUndefinedOrNull(b,"Assert is-true failed. Actual: {0}."))},isFalse:function(a,b){return bob.assert.equals(!1,a,bob.utils.ifUndefinedOrNull(b,"Assert is-false failed. Actual: {0}."))},throwsError:function(a,b){if(!bob.utils.isFunction(a))throw Error("Wrong argument: fnTest.");bException=!1;try{a()}catch(c){bException=!0}bException||bob.assert.fail(bob.utils.ifUndefinedOrNull(b,
"Assert throws-error failed."))},isUndefined:function(a,b){return bob.assert.isTrue(bob.utils.isUndefined(a),bob.utils.ifUndefinedOrNull(b,bob.string.formatString("Assert is-undefined failed. Actual: {0}.",a)))},isNull:function(a,b){return bob.assert.isTrue(bob.utils.isNull(a),bob.utils.ifUndefinedOrNull(b,bob.string.formatString("Assert is-null failed. Actual: {0}.",a)))},isUndefinedOrNull:function(a,b){return bob.assert.isTrue(bob.utils.isUndefinedOrNull(a),bob.utils.ifUndefinedOrNull(b,bob.string.formatString("Assert is-undefined-or-null failed. Actual: {0}.",
a)))}});
bob.ns.setNs("bob.collections.extensions",{equals:function(a,b,c){if(bob.utils.isUndefinedOrNull(c))c=function(a,b){return bob.utils.equals(a,b)};else if(!bob.utils.isFunction(c))throw Error("Wrong argument: fnEquals.");for(var a=bob.collections.getEnumerator(a),b=bob.collections.getEnumerator(b),d=a.next(),e=b.next();d&&e;){if(!c(a.get_current(),b.get_current()))return!1;d=a.next();e=b.next()}return d==e?!0:!1},clone:function(a,b,c,d){if(!bob.utils.isArray(a))throw Error("Wrong argument: array");d=
bob.utils.ifUndefinedOrNull(d,[]);b=bob.utils.ifUndefinedOrNull(b,0);for(c=bob.utils.ifUndefinedOrNull(c,a.length-1);b<=c;b++)d.push(a[b]);return d},any:function(a,b){if(!bob.utils.isFunction(b))throw Error("Wrong argument: fnAny.");for(var c=bob.collections.getEnumerator(a),d=0;c.next();)if(b.call(c.get_current(),d++,c.get_current()))return!0;return!1},all:function(a,b){if(!bob.utils.isFunction(b))throw Error("Wrong argument: fnAll.");return!bob.collections.extensions.any(a,function(a,d){return!b(a,
d)})},forEach:function(a,b){if(!bob.utils.isFunction(b))throw Error("Wrong argument: fnForEach.");for(var c=bob.collections.getEnumerator(a),d=0;c.next();)b.call(c.get_current(),d++,c.get_current())}});
bob.ns.setNs("bob.collections",{Enumerator:function(a,b){if(!bob.utils.isFunction(a))throw Error("Wrong argument: fnHasNext.");if(!bob.utils.isFunction(b))throw Error("Wrong argument: fnGetNext.");var c=bob.prop.namedProp(this,"current",void 0,!0);this.next=function(){return a()?(c(b()),!0):!1}},arrayEnumerator:function(a){if(!bob.utils.isArray(a))throw Error("Wrong argument: array.");var b=-1;return new bob.collections.Enumerator(function(){return b<a.length-1},function(){return a[++b]})},stringEnumerator:function(a){if(!bob.utils.isString(a))throw Error("Wrog argument: str.");
var b=-1;return new bob.collections.Enumerator(function(){return b<a.length-1},function(){return a[++b]})},objectEnumerator:function(a){if(!bob.utils.isObject(a))throw Error("Wrong argument: obj.");var b=[],c;for(c in a)b.push({name:c,value:a[c]});return bob.collections.arrayEnumerator(b)},getEnumerator:function(a){if(bob.utils.isArray(a))return bob.collections.arrayEnumerator(a);if(bob.utils.isString(a))return bob.collections.stringEnumerator(a);if(bob.utils.isObject(a))return bob.collections.objectEnumerator(a);
if(!bob.utils.isUndefinedOrNull(a)&&bob.utils.isFunction(a.getEnumerator))return a.getEnumerator();throw Error("Wrong argument: objAny.");}});bob.ns.setNs("bob.ns",{});
bob.ns.setNs("bob.prop",{Property:function(a,b){var c=this,d=a;this.get_value=function(){return d};var e=function(a){d=a};b?this.get_setter=function(a){a||delete c.get_setter;return e}:this.set_value=e},namedProp:function(a,b,c,d){if(bob.utils.isUndefinedOrNull(a))throw Error("Argument null: objThis.");if(bob.utils.isNullOrWhiteSpace(b))throw Error("Wrong argument: sName");c=new bob.prop.Property(c,d);a["get_"+b]=c.get_value;if(d)return c.get_setter();a["set_"+b]=c.set_value}});
bob.ns.setNs("bob.serialization",{objectToString:function(a,b){var c=typeof a;if(bob.utils.isUndefinedOrNull(a)||bob.utils.equalsAny(c,["number","boolean"]))return""+a;if("string"===c||bob.utils.isDate(a))return b?bob.utils.quote(a):""+a;if("function"===c)return"function() { }";if(bob.utils.isArray(a)){for(var c="[ ",d=0;d<a.length;d++)0<d&&(c+=", "),c+=bob.serialization.objectToString(a[d],!0);c+=" ]"}else{var c="{ ",e=0;for(d in a)0<e++&&(c+=", "),c+=bob.utils.quote(d)+": ",c+=bob.serialization.objectToString(a[d],
!0);c+=" }"}return c}});bob.ns.setNs("bob.string",{formatString:function(a){if(bob.utils.isNullOrWhiteSpace(a))throw Error("Wrong argument: sFormat.");var b=arguments;return a.replace(/({)(\d+)(})/gi,function(a,d,e){a=1*e+1;if(b.length<a+1)throw Error(bob.string.formatString("Cannot format string: argument at index {0} not found.",e));return b[a]})}});
bob.ns.setNs("bob.unitTest",{runTestObject:function(a){if(!bob.utils.isObject(a))throw Error("Wrong argument: objTest.");var b=!0,c;for(c in a){var d=a[c];if(bob.utils.isFunction(d))try{d(),console.log(bob.string.formatString('SUCCESS in Test Function "{0}".',c))}catch(e){b=!1,console.log(bob.string.formatString('FAILURE in Test Function "{0}": {1}.',c,e.message))}}return b}});
bob.ns.setNs("bob.utils",{isNullOrWhiteSpace:function(a,b){if(bob.utils.isUndefinedOrNull(a))return!0;if(!bob.utils.isString(a)){if(b)throw Error("Wrong argument: str.");return!1}return!a.trim()?!0:!1},ifUndefined:function(a,b){return bob.utils.isUndefined(a)?b:a},ifNull:function(a,b){return bob.utils.isNull(a)?b:a},ifUndefinedOrNull:function(a,b){return bob.utils.isUndefinedOrNull(a)?b:a},ifNullOrWhiteSpace:function(a,b){return bob.utils.isNullOrWhiteSpace(a)?b:a},isNumber:function(a){return"number"===
typeof a},isBoolean:function(a){return"boolean"===typeof a},isString:function(a){return"string"===typeof a},isDate:function(a){return bob.utils.isUndefinedOrNull(a)?!1:0<Object.prototype.toString.call(a).indexOf("Date")},isFunction:function(a){return"function"===typeof a},isArray:function(a){if(bob.utils.isUndefinedOrNull(a))return!1;a=Object.prototype.toString.call(a);return 0<a.indexOf("Array")||0<a.indexOf("Arguments")},isObject:function(a,b,c){b=b?!1:bob.utils.isUndefined(a);c=c?!1:bob.utils.isNull(a);
return!b&&!c&&!bob.utils.isNumber(a)&&!bob.utils.isBoolean(a)&&!bob.utils.isString(a)&&!bob.utils.isDate(a)&&!bob.utils.isFunction(a)&&!bob.utils.isArray(a)},equals:function(a,b){return 2>arguments.length?!1:typeof a===typeof b&&a==b},equalsAny:function(a,b){return 2>arguments.length?!1:bob.collections.extensions.any(b,function(c){return bob.utils.equals(a,b[c])})},Lazy:function(a){if(!bob.utils.isFunction(a))throw Error("Wrong argument: fnCreate.");var b=this,c=bob.prop.namedProp(this,"isValueCreated",
!1,!0),d=void 0;this.getValue=function(){b.get_isValueCreated()||(d=a(),c(!0));return d}},lazyFunction:function(a){return(new bob.utils.Lazy(a)).getValue},quote:function(a){return'"'+a+'"'}});
